package com.ivo.service.pm;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.ivo.dao.HibernateCaller;
import com.ivo.model.pm.FollowUpRequisition;

public class PmService extends HibernateCaller
{

	public PmService()
	{
	}

	/**
	 * Follow Up
	 */
	@Transactional
	public FollowUpRequisition getFollowUpRequisition(Long followUpRequisition_ID)
	{
		FollowUpRequisition followUpRequisition = (FollowUpRequisition) getObject( FollowUpRequisition.class, followUpRequisition_ID );
		return followUpRequisition;
	}

	public List<FollowUpRequisition> getFurByRD(String condition)
	{

		if( condition == null || condition.equals( "" ) )
		{
			condition = "";
		} else {
			condition = " and ( a.memo like '%" + condition + "%' or a.trackingNumber like '%" + condition + "%' )";
		}

		String hql = "from FollowUpRequisition a where a.validFlag = 1 and a.category_FK in ('CD','DWM','NPS','NPWM','QRB') and a.orderTask_FK not in ('000','020','990') " + condition;
		List list = find( hql );
		return list;
	}

}
